//
//  DetailsInfoView.m
//  作业tableView通讯录
//
//  Created by dllo on 16/6/17.
//  Copyright © 2016年 zuzhiming. All rights reserved.
//

#define MAS_SHORTHAND
#define MAS_SHORTHAND_GLOBALS
#import "DetailsInfoView.h"
#import "Masonry.h"
@interface DetailsInfoView ()
@property (nonatomic, retain) UILabel *nLabel;

@end



@implementation DetailsInfoView

- (void)dealloc
{
    [_nLabel release];
    [_content release];
    [super dealloc];
}


- (instancetype)initWithFrame:(CGRect)frame withName:(NSString *)string
{
    self = [super initWithFrame:frame];
    if (self) {
        
      self.nLabel = [[UILabel alloc] init];
        self.nLabel.text = string;
        [self addSubview:_nLabel];
        [_nLabel release];
        
        self.content = [[UITextField alloc] init];
        
        [self addSubview:_content];
        [_content release];
        
        [self setPropertys];
    }
    return self;
}

- (void)setPropertys
{
    self.nLabel.textAlignment = NSTextAlignmentCenter;
    self.content.borderStyle = UITextBorderStyleRoundedRect;
    self.content.placeholder = @"请输入";

}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    [self.nLabel makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(UIEdgeInsetsMake(0, 0, 0, CGRectGetWidth(self.bounds) - 100));
    }];
    
    [self.content makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(UIEdgeInsetsMake(10, CGRectGetWidth(self.bounds) - 200, 10, 0));
    }];
}





@end
